<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="mn">美女</button>
    <button id="mt">美腿</button><br>
    <img src="images/mn.jpg" alt="" width="300px" height="300px">

    <script>
        // 修改元素属性 src
        // 1. 获取元素
        var mn = document.getElementById('mn');
        var mt = document.getElementById('mt');
        var img = document.querySelector('img');
        // 2. 注册事件 处理程序
        mt.onclick = function(){
            img.src = "images/mt.jpg";
            img.title= '美腿';
        }
        mn.onclick = function(){
            img.src = "images/mn.jpg";
            img.title = '美女';
        }
    </script>
</body>
</html>